/**
 * 
 */
package com.mevoy.async.dao.exception.aop;

import org.apache.log4j.Logger;
import org.aspectj.lang.annotation.AfterThrowing;
import org.aspectj.lang.annotation.Aspect;

import com.mevoy.async.dao.exception.ReportAccessException;

/**
 * @author diegoicosta
 * 
 */
@Aspect
public class AfterThrowExceptionInDao {
	Logger logger = Logger.getLogger(this.getClass());

	@AfterThrowing(pointcut = "execution(* com.mevoy.async.dao..*.*(..))", throwing = "ex")
	public void takeCare(Throwable ex) throws ReportAccessException{
		logger.warn("Exception Interceptada: " + ex.getMessage());
		throw new ReportAccessException(ex);
	}

}
